package com.molin.exceptionTest;

import java.util.Scanner;

public class Demo6 {
    public static void main(String[] args) {
        try {
        Scanner sc = new Scanner(System.in);
        System.out.print("input your age: ");
        int line = sc.nextInt();
        System.out.println(line);
        System.out.println(2 / 0);
    } catch (ArithmeticException e) {
        System.out.println("不能除以0");
    } catch (Exception e) {
        System.out.println("输入错误！");
    }
        System.out.println("程序结束");
}
}
